<template>
	<div>
		<Menu/>
		<Head/>

		<div class="company_add_pro">
			<h3>&nbsp;</h3>
			<h3 style="text-align:left">新增证券</h3>
			<h3>&nbsp;</h3>
			<form>
				证券编码: <input type="text" v-model='stock_code' /><br /><br />
				交 易 所 : <select v-model='jys'>
								<option value="sz">深圳</option>
								<option value="sh">上海</option>
							</select><br /><br />
				<input type="button" @click="company_add()" value="提 交"/>
			</form>
		</div>
	</div>
</template>

<script>
	import Menu from '../../components/Menu.vue'
	import Head from '../../components/Head.vue'
	export default {
		name:"CompanyAddView",
		components:{
			Menu,
			Head,
		},
		data(){
			return {
				stock_code:'',
				jys:'sz',
			}
		},
		methods:{
			company_add(){
				if (!this.stock_code|| this.stock_code == null || this.stock_code==undefined || this.stock_code=='undefined') {
					alert('证券编码 不能为空');
					return
				}
				if (!this.jys|| this.jys == null || this.jys==undefined || this.jys=='undefined') {
					alert('证券编码 不能为空');
					return
				}

				this.$axios.post('/api/v1/company/company_add', {'stock':this.stock_code,'jys':this.jys}, {headers:{'Content-Type':'multipart/form-data; charset=utf-8', 'Accept':'*/*','Connection':'keep-alive'}}).then(function (response) {
					alert(response.data.data);
				});
			},
		},
		mounted: function(){
			// this.company_add();
		}
	}
</script>
<style scoped>
	*{
		padding: 0;
		margin:0;
	}
	.company_add_pro{
		padding-left: 3%;
		float: left;
		margin-left: 5%;
		margin-top: 2%;
		width: 76%;
		height: 816px;
		border:1px solid #EAEAEA;
	}
</style>